package com.nuoniu.sibanyun.entity.finance;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 应收应付单主表
 * </p>
 *
 * @author 小啊刚
 * @since 2021-04-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("fa_rec_pay")
@ApiModel(value="VReceivableMain对象", description="应收单主表")
public class VReceivablePayableMain extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "类型1应收 2应付")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "单据类型:1应收 2其它应收 3应付 4其他应付")
    @TableField("data_source")
    private String dataSource;

    @ApiModelProperty(value = "单据编码")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "业务日期")
    @TableField("voucher_date")
    private String voucherDate;

    @ApiModelProperty(value = "业务类型: 1销售应收单，2费用应收，3资产应收、4转销售应收")
    @TableField("voucher_type")
    private Integer voucherType;

    @ApiModelProperty(value = "往来类型(1:供应商2:客户3:员工4:部门5:其它往来单位)")
    @TableField("partner_type")
    private Integer partnerType;

    @ApiModelProperty(value = "往来单位id")
    @TableField("partner_id")
    private Integer partnerId;

    @ApiModelProperty(value = "往来单位")
    @TableField("partner_name")
    private String partnerName;

    @ApiModelProperty(value = "科目id")
    @TableField("accounting_id")
    private Integer accountingId;

    @ApiModelProperty(value = "科目名称")
    @TableField("accounting_name")
    private String accountingName;

    @ApiModelProperty(value = "科目编码")
    @TableField("accounting_code")
    private String accountingCode;

    @ApiModelProperty(value = "客户id")
    @TableField("crm_id")
    private Integer crmId;

    @ApiModelProperty(value = "客户名称")
    @TableField("crm_name")
    private String crmName;

    @ApiModelProperty(value = "业务部门id")
    @TableField("office_id")
    private Integer officeId;

    @ApiModelProperty(value = "业务部门名称")
    @TableField("office_name")
    private String officeName;

    @ApiModelProperty(value = "业务id")
    @TableField("salesman_id")
    private Integer salesmanId;

    @ApiModelProperty(value = "业务员名称")
    @TableField("salesman_name")
    private String salesmanName;

    @ApiModelProperty(value = "摘要")
    @TableField("digest")
    private String digest;

    @ApiModelProperty(value = "借贷方向1:借2:贷")
    @TableField("dc_direction_flag")
    private Integer dcDirectionFlag;

    @ApiModelProperty(value = "期初标识0:否 1:是")
    @TableField("begin_start_flag")
    private Integer beginStartFlag;

    @ApiModelProperty(value = "到期日期")
    @TableField("expire_date")
    private LocalDateTime expireDate;

    @ApiModelProperty(value = "收款条件")
    @TableField("receive_condition")
    private String receiveCondition;

    @ApiModelProperty(value = "币种")
    @TableField("currency_id")
    private Integer currencyId;

    @ApiModelProperty(value = "币种名称")
    @TableField("currency_name")
    private String currencyName;

    @ApiModelProperty(value = "单据状态 0:未审 1:已审")
    @TableField("voucher_state")
    private Integer voucherState;

    @ApiModelProperty(value = "记账状态: 0:未记 1:已记")
    @TableField("book_state")
    private Integer bookState;

    @ApiModelProperty(value = "结算状态: 0:未结 1:已结")
    @TableField("settle_state")
    private Integer settleState;

    @ApiModelProperty(value = "是否成生凭证0:否 1:是")
    @TableField("is_create_voucher")
    private Integer isCreateVoucher;

    @ApiModelProperty(value = "金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "本币金额")
    @TableField("lc_amount")
    private BigDecimal lcAmount;

    @ApiModelProperty(value = "税额")
    @TableField("tax")
    private BigDecimal tax;

    @ApiModelProperty(value = "价税合计")
    @TableField("price_tax_total")
    private BigDecimal priceTaxTotal;

    @ApiModelProperty(value = "汇率")
    @TableField("exch_rate")
    private BigDecimal exchRate;

    @ApiModelProperty(value = "已核销金额")
    @TableField("verification_amount")
    private BigDecimal verificationAmount;

    @ApiModelProperty(value = "创建人id")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建人姓名")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "创建日期")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "提交人id")
    @TableField("submit_user_id")
    private Integer submitUserId;

    @ApiModelProperty(value = "提交人姓名")
    @TableField("submit_user_name")
    private String submitUserName;

    @ApiModelProperty(value = "提交日期")
    @TableField("submit_date")
    private LocalDateTime submitDate;

    @ApiModelProperty(value = "审核人id")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "审核人姓名")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @ApiModelProperty(value = "审核日期")
    @TableField("reviewer_date")
    private LocalDateTime reviewerDate;

    @ApiModelProperty(value = "修改人")
    @TableField("update_user_id")
    private Integer updateUserId;

    @ApiModelProperty(value = "修改人名称")
    @TableField("update_user_name")
    private String updateUserName;

    @ApiModelProperty(value = "修改人日期")
    @TableField("update_date")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "来源单id")
    @TableField("source_voucher_id")
    private Integer sourceVoucherId;

    @ApiModelProperty(value = "来源单据")
    @TableField("source_voucher_type")
    private String sourceVoucherType;

    @ApiModelProperty(value = "来源日期")
    @TableField("source_voucher_date")
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "来源单号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "记账人id")
    @TableField("bookkeeper_id")
    private Integer bookkeeperId;

    @ApiModelProperty(value = "记账人名称")
    @TableField("bookkeeper_name")
    private String bookkeeperName;

    @ApiModelProperty(value = "记账日期")
    @TableField("book_date")
    private LocalDateTime bookDate;

    @ApiModelProperty(value = "应收单明细")
    @TableField(exist = false)
    private List<VReceivablePayableDetail> orderDetailList;

    @ApiModelProperty(value = "应收单收款计划")
    @TableField(exist = false)
    private List<VReceivePaymentPlan> planList;
}
